package com.prime.tutorial.moviestore.service.customer;

import com.prime.tutorial.moviestore.domain.*;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: vasylja
 * Date: May 6, 2010
 * Time: 8:27:57 PM
 *
 * @author vasylja
 */
public interface CustomerService {
       /**
         * Returns all available user groups
         * @return list of groups
         */
       public List<CustomerGroups> getAllCustomerGroups();

        /**
         * Returns all users
         * @return list of users
         */
       public List<Customers> getAllCustomers();

        /**
         * Checks whether user with this login exists in the database
         * @param login login
         * @return true if exists, false therwise
         */
       public Boolean loginExists(String login);

        /**
         * Returns groups by name
         * @param name group name
         * @return list of Groups
         */
       public List<CustomerGroups> findByName(String name);

        /**
         * Creates new user
         * @param customer customer to create
         */
       @Transactional
       public void createNew(Customers customer);

        /**
         * Removes user
         * @param customer customer to remove
         */
       @Transactional
       public void deleteCustomer(Customers customer);

        /**
         * Updates user
         * @param customer customer to update
         */
       @Transactional
       public void updateCustomer(Customers customer);

    /**
     * Checks whether the code of the card which the user uses to make the payment exists in the database.
     * @param code code which identifies the card
     */

       public Boolean checkCardExists(Long code);

    /**
     * Finds the card with the matching code.
     * @param code code of the card to find.
     */

      public List<PayCard> getCardWithCode(Long code);

    /**
     * Acomplishes the payment.
     * @param payment the payment to be made
     */
      @Transactional
      public void makePayment(Payment payment);
//TODO Add javadoc
    public List getAllRatesForCustomer(Customers customer);

    public List getAllPaymentsForCustomer(Customers customer);
}
